# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Tom Gundersen <teg@jklm.no>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Aaron Griffin <aaron@archlinux.org>
# Contributor: Jochem Kossen <j.kossen@home.nl>
# Contributor: Hendrik Meyer <archlinux@t4cc0.re>

pkgname=lsof
pkgver=4.98.0
pkgrel=2
pkgdesc='Lists open files for running Unix processes'
url='https://github.com/lsof-org/lsof'
arch=('loong64' 'x86_64')
license=('custom')
depends=(
  glibc
  libtirpc
)
makedepends=(
  groff
)
source=(https://github.com/lsof-org/lsof/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('6fde12497ce9cbba698be624b45e8392d551626c3e46b50ec23e661b322438ef7162dbac0d06829d56f074c7d934fa1ca98aa50ee1487125c93bebfe8eb2a2e8')

build() {
  cd ${pkgname}-${pkgver}
  autoreconf -fiv
  ./configure \
    --prefix=/usr \
    --enable-security \
    --enable-no-sock-security \
    --with-libtirpc
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
